import csv

with open("test.csv", mode="w") as f:
    cf = csv.writer(f)
    cf.writerow(["张三", 10, "男"])
    cf.writerows([["李四", 20, "男"], ["王五", 30, "女"]])